package com.blb.community.service.impl;

import com.blb.community.entity.ZyRepair;
import com.blb.community.mapper.ZyRepairMapper;
import com.blb.community.service.IZyRepairService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 报修信息 服务实现类
 * </p>
 *
 * @author 帅帅
 * @since 2022-07-02
 */
@Service
public class ZyRepairServiceImpl extends ServiceImpl<ZyRepairMapper, ZyRepair> implements IZyRepairService {

    @Autowired
    private ZyRepairMapper zyRepairMapper;

    /**
     * 查询所有
     * @return
     */
    @Override
    public List<ZyRepair> selectRepairAll() {
        return zyRepairMapper.selectRepairAll();
    }

    /**
     * 查询报修信息列表
     * @param zyRepair 对象
     * @param nowPage 当前页
     * @param pageSize 页面数据大小
     * @return
     */
    @Override
    public List<ZyRepair> selectZyRepairList(ZyRepair zyRepair, int nowPage, int pageSize) {
        return zyRepairMapper.selectZyRepairList(zyRepair,(nowPage-1)*pageSize,pageSize);
    }

    /**
     * 修改报修信息
     * @param zyRepair
     * @return
     */
    @Override
    public int updateRepair(ZyRepair zyRepair) {
        return zyRepairMapper.updateRepair(zyRepair);
    }
}
